import { post, get } from '@/utils/request'

const addReservation = params => post('/reservation/add', params)
const updateReservation = params => post('/reservation/updateProperty', params)
const cancelReservation = (params) => post(`/reservation/cancel/1/${params.consultId}`)
const getReservation = ({questionId}) => get(`/reservation/${questionId}`)
//默认学生id1，status为0，表示还没有进行
const getReserveConsult = (params) => get(`/reservation/student/1/${params.status}`)
const getConsultantReserve = (params) => get(`/reservation/consultant/1/${params.status}`)
const getAllReservationPage = (params)=>get(`/reservation/all/${params.pageNum}/${params.pageSize}`)
const getReservationPage = (params)=>get(`/reservation/${params.consultId}/${params.pageNum}/${params.pageSize}`)
const advice = params => post('/reservation/advice', params)
const statics = (params) =>get(`/reservation/statics/${params.year}/${params.month}`)
const yearStatics = (params) =>get(`/reservation/statics/year/${params.year}`)
const finish = (params) =>get(`/reservation/finish/${params.id}`)
const searchByUsername = (params)=>get(`/reservation/search/student/${params.username}/${params.pageNum}/${params.pageSize}`)




const listReservation = () => get('/reservation/listProperty')

export {
  addReservation,
  updateReservation,
  getReservation,
  listReservation,
  cancelReservation,
  getReserveConsult,
  getConsultantReserve,
  getAllReservationPage,
  getReservationPage,
  advice,
  statics,
  finish,
  yearStatics,
  searchByUsername
}
